package name.zxw.rabbitmq.consumer;

import lombok.extern.slf4j.Slf4j;
import name.zxw.rabbitmq.config.ConfirmConfig;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author zhangxinwang
 * @date 2022/6/28 17:03
 */
@Slf4j
@Component
public class WarningConsumer {

    @RabbitListener(queues = ConfirmConfig.WARNING_QUEUE_NAME)
    public void receiveWarningMessage(Message message) {
        log.warn("收到警告:{}", new String(message.getBody()));
    }


}
